const API_BASE = 'http://localhost:5000' // 替换为你的后端API地址

export const fetchBirds = async () => {
  const response = await fetch(`${API_BASE}/birds/getAllBirds`);
  if (!response.ok) throw new Error('Failed to fetch birds');
  return response.json();
};

export const fetchBirdDetail = async (id) => {
  const response = await fetch(`${API_BASE}/birds/getBirdsByID?id=1${id}`);
  if (!response.ok) throw new Error('Failed to fetch bird details');
  return response.json();
};